package Main;
import User.User;
import User.administorUser;
import User.nomalUser;
import java.util.Scanner;
import book.*;
public class Main {
    protected static User login(){
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入你的名字:");
        String name=sc.nextLine();
        System.out.println("1.管理员    2.普通用户");
        Scanner scanner=new Scanner(System.in);
        int choice=scanner.nextInt();
        if(choice==1){
            return (User)new administorUser(name);
        }else{
            return (User)new nomalUser(name);
        }
    }
    public static void main(String[] args) {
        bookList booklist=new bookList();
        User user =login();
        while(true){
            int x=user.menu();
            user.dooperation(x,booklist);
        }
    }
}
